<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ProfileLink
 *
 * @author pavlov
 */
class Alyce_View_Helper_ProfileLink extends Zend_View_Helper_Abstract {

    public function profileLink() {
        $auth = Zend_Auth::getInstance();
        if ($auth->hasIdentity()) {
            print_r($auth->getIdentity()->realname);
            $username = $auth->getIdentity();
            $link = "";
            
            $link = '<a href="/users/profile/' . $username . '">Welcome, ' . $username . '</a> | ';
            $link .= '<a href="/users/login/logout">Logout</a>';
            return $link;
        }

        return '<a href="/users/login">Login</a>';
    }

}

?>
